import Vue from 'vue'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import App from './App11.vue'

Vue.use(ElementUI);


Vue.config.productionTip = false
// 全局指令
Vue.directive('show111', (element, binding) => {
  if (binding.value) {
    // element.style.display = 'none'
    element.style.color = 'red'
    element.style.fontSize = '100px'
  }
})
// 全局axios
import axios from 'axios';
Vue.prototype.$axios = axios;


// 全局过滤器
Vue.filter('myNum', (val) => {
  return val + 10
})

import datafrom from './router/datafrom.vue'
Vue.component('xinzeng', datafrom)

// 分页器
import gong from './router/gong.vue'
Vue.component('gonggong', gong)

import 分页器 from './SOM/分页器.vue'
Vue.component('getdang', 分页器)

import 用户 from './SOM/用户.vue'
Vue.component('getdang1', 用户)

import 商品 from './SOM/商品.vue'
Vue.component('getdang11', 商品)


// 全局组件
import child from './SOM/child.vue'
Vue.component('comchild', child)

import change from './SOM/change.vue'
Vue.component('SONson', change)

import change1 from './SOM/change1.vue'
Vue.component('cino11', change1)

import change2 from './SOM/change2.vue'
Vue.component('SONchange', change2)

import glaid from './SOM/glaid.vue'
Vue.component('gad', glaid)

//要把router注入到vue里
import VueRouter from "vue-router";
Vue.use(VueRouter)
// 路由重复
const originalPush = VueRouter.prototype.push;
// 修改 原型对象中的push方法
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}
// 路由重复
const originalReplace = VueRouter.prototype.replace;
// 修改 原型对象中的replace方法
VueRouter.prototype.replace = function replace(location) {
  return originalReplace.call(this, location).catch(err => err)
}
// 注册router
import router from '../src/router/router'

import store from './vuex/store.js'

new Vue({
  store,
  router,
  render: h => h(App),
}).$mount('#app')
